package io.adrainty.bolee.security.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.adrainty.bolee.security.models.bo.ResourceBO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author AdRainty
 * @version V1.0.0
 * @since 2025/8/9 下午11:34
 */

@Mapper
public interface IResourceMapper extends BaseMapper<ResourceBO> {

    /**
     * 根据用户ID查询用户权限
     * @param userId 用户ID
     * @return 用户权限
     */
    List<ResourceBO> findResourceByUserId(Long userId);

    /**
     * 根据角色ID查询角色权限
     * @param roleIdList 角色ID
     * @return 角色权限
     */
    List<ResourceBO> findResourceByRoleIds(@Param("roleIdList") List<Long> roleIdList);
}
